-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Implement .NET conformance testing #314
base: main
Are you sure you want to change the base?
Conversation
// We can't just go run the pulumi-test-language package because of | ||
// https://github.com/golang/go/issues/39172, so we build it to a temp file then run that. | ||
binary := t.TempDir() + "/pulumi-test-language" | ||
cmd := exec.Command("go", "build", "-C", "../cmd/pulumi-test-language", "-o", binary) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I'm pretty sure you can go build a git address so you don't need to clone it into the repo
pulumi-language-dotnet/main.go
Outdated
|
||
cmd := exec.Command(host.exec, "pack", "-c", "Release", "-o", destination) | ||
cmd.Dir = req.PackageDirectory | ||
cmd.Env = os.Environ() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this the default?
pulumi-language-dotnet/main.go
Outdated
} | ||
|
||
return &pulumirpc.PackResponse{ | ||
ArtifactPath: destination, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should return the actual nuget file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed this
} else if !versionsMatch(expectedDependency.Version, *found) && expectedDependency.Name != "pulumi" { | ||
return makeTestResponse(fmt.Sprintf("dependency %s has unexpected version %s, expected %s", | ||
expectedDependency.Name, *found, expectedDependency.Version)), nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is where I made the change to exclude testing pulumi
core sdk version, otherwise I didn't understand where the version was coming from since the nuget has v1.0.0
This PR is an initial implementation of .NET conformance tests. It extends pulumi-language-dotnet with
GenerateProject
,GeneratePackage
andPack
The actual tests require
pulumi-test-language
which is a command line Go tool from pulumi/pulumi. This I had to copy over using a new build commandsync-pulumi-test-language
(I don't think we want to do this so we might need to publish it and consume it from here)It requires changes from pulumi/pulumi#16902 to correctly emit the paths and version of local dependencies.
There is a problem where the pulumi-test-language tries to assert the core sdk version but it doesn't match for some reason, so I had to disable this check for the
pulumi
dependency. I couldn't quite get where the version was retrieved from because when we pack Pulumi.csproj it doesn't have a version and defaults to 1.0.0 but the tests want a specific version that doesn't match (see below) cc @Frassle